Skip to content

Conversation

@HiPhish
Copy link
Contributor

@HiPhish HiPhish commented Apr 15, 2025

Closes #169. If the URL of a navigation item is missing the scheme or the network location we ignore it in the check.

@HiPhish HiPhish requested a review from a team as a code owner April 15, 2025 18:59
Comment on lines 144 to 147
parsed_url.scheme
and (parsed_url.scheme != parsed_request.scheme)
or parsed_url.netloc
and (parsed_url.netloc != parsed_request.netloc)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please group these by the order of operations so that it's easier to maintainer.

I think you were going for roughly:

if (
    (parsed_url.scheme and parsed_url.scheme != parsed_request.scheme)
    or
    (parsed_url.netloc and parsed_url.netloc != parsed_request.netloc)
):

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boolean operators have higher precedence than comparison operators, so wouldn't (parsed_url.scheme and parsed_url.scheme != parsed_request.scheme) be the same as ((parsed_url.scheme and parsed_url.scheme) != parsed_request.scheme)? This would compare a boolean to a string, which will always fail. What I wanted to express was (parsed_url.scheme and (parsed_url.scheme != parsed_request.scheme)).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. I think the latter might make the most sense then. I think the grouping would spell it out more and be easier for us to maintain.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I have added parentheses around the operators of the or.

@HiPhish
Copy link
Contributor Author

HiPhish commented May 11, 2025

bump Is there anything that's missing?

Copy link
Member

@joshuadavidthomas joshuadavidthomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, looks good. Sorry for the delay in actually reviewing this, thanks for the contribution.

HiPhish and others added 2 commits June 3, 2025 14:24
Closes westerveltco#169.  If the URL of a navigation item is missing the scheme or
the network location we ignore it in the check.
@joshuadavidthomas joshuadavidthomas enabled auto-merge (squash) June 3, 2025 19:24
@joshuadavidthomas joshuadavidthomas merged commit 62565ad into westerveltco:main Jun 3, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ignore empty parsed_url.scheme and netloc in get_active

3 participants